const { Schema, SchemaTypes, model, models } = require("mongoose");
require("./Commodity");
require("./Page");
require("./Swiper");
require("./HotSearch");
require("./Icon");
const HomeConfigSchema = new Schema(
    {
        tips: { type: String },
        searchVisible: { type: Boolean },
        hotSearches: [{ type: SchemaTypes.ObjectId, ref: "HotSearch" }],
        hotSearchesVisible: [{ type: Boolean }],
        icons: [{ type: SchemaTypes.ObjectId, ref: "Icon" }],
        iconsVisible: { type: Boolean },
        swipers: [{ type: SchemaTypes.ObjectId, ref: "Swiper" }],
        swipersVisible: { type: Boolean },
        commodities: [{ type: SchemaTypes.ObjectId, ref: "Commodity" }],
        commoditiesVisible: { type: Boolean },
    },
    {
        timestamps: {
            createdAt: "createTime",
            updatedAt: "updateTime",
        },
    }
);
let HomeConfigModel = models["HomeConfig"] || model("HomeConfig", HomeConfigSchema);
module.exports = HomeConfigModel;